package com.dpy.config_client.ctr;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/mvc")
@RefreshScope //依赖 actuator 模块，通过curl -X POST http://localhost:8080/actuator/refresh 刷新
public class RestfulCtr {
    @Value("${testValue}")
    String config;

    @GetMapping("/config/get")
    public String testConfig(){
        return config;
    }
}
